package cn.xxc.system.service.impl;

import cn.xxc.basic.service.impl.BaseServiceImpl;
import cn.xxc.system.domain.Systemdictionarytype;
import cn.xxc.system.mapper.SystemdictionarydetailMapper;
import cn.xxc.system.service.SystemdictionarytypeSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SystemdictionarytypeSerivceImpl extends BaseServiceImpl<Systemdictionarytype> implements SystemdictionarytypeSerivce {
    @Autowired
    private SystemdictionarydetailMapper systemdictionarydetailMapper;
    @Override
    public void del(Long id) {
        List<Long> longs = systemdictionarydetailMapper.queryByid(id);
        if (longs.size()!=0) {
            Long[] ids = (Long[])(longs.toArray(new Long[longs.size()])) ;
            systemdictionarydetailMapper.patchDel(ids);
        }
        super.del(id);
    }

    @Override
    public void patchDel(Long[] ids) {

        for (Long id : ids) {
            List<Long> longs = systemdictionarydetailMapper.queryByid(id);
            if (longs.size()!=0) {
                Long[] idss = (Long[])(longs.toArray(new Long[longs.size()])) ;
                systemdictionarydetailMapper.patchDel(idss);
            }
        }
        super.patchDel(ids);
    }
}
